@extends('frontend/layouts/default')
@section('title')
Blog
@stop

@section('header2')
@include('frontend/blogs/includes/menu-blog',array('categories'=>$data['categories']))
@endsection

@section('content')
<!--content left-->
<div class="width615 FL">
    <!--feature-->
    <div>
        <div class="news-blog">
            <div>
                <div class="feature-news MgL5">
                    <a href="<?= route('detail-blog', array('id' => $data['hot_blog'][0]->id, 'slug' => $data['hot_blog'][0]->slug)) ?>"
                       title="<?= $data['hot_blog'][0]->title ?>">
                        <img src="<?= Config::get('constants.URL_IMAGE_BLOG') . $data['hot_blog'][0]->thumbnail ?>"
                             alt="news 1"
                             width="605px" height="342px">

                        <div class="text-content-bl">
                            <h1 class="font18"><?= $data['hot_blog'][0]->title ?> </h1>

                            <h2 class="font14"><?= str_limit(strip_tags($data['hot_blog'][0]->content), 200, '..') ?></h2>
                            <span class="bg-content-ft"></span>
                        </div>
                    </a>
                    <? unset($data['hot_blog'][0]) ?>
                </div>
                <div class="thumb-news">
                    <ul>
                        @foreach($data['hot_blog'] as $hotBlog)
                        <li class="MgL5 MgR5">
                            <a href="<?= route('detail-blog', array('id' => $hotBlog->id, 'slug' => $hotBlog->slug)) ?>"
                               title="{{ $hotBlog->title}}">
                                <img src="<?= Config::get('constants.URL_IMAGE_BLOG') . $hotBlog->thumbnail ?>"
                                     alt="{{ $hotBlog->title }}" width="195px" height="130px">

                                <div class="text-content-bl">
                                    <h1 class="font12">{{ $hotBlog->title }}</h1>
                                    <span class="bg-content-ft"></span>
                                </div>
                            </a>
                        </li>
                        @endforeach
                    </ul>
                </div>
            </div>
            <div>
                <div class="title">
                    <label>Các tin khác</label>
                </div>
                <div class="list-news-bl">
                    <ul>
                        <?
                        foreach ($data['categories'] as $category) {
                            if (!is_null($cBlog = $category->blogs()->orderBy('id', 'DESC')->first())) {

                                ?>
                                <li>
                                    <div>
                                        <h1 class="font21 color55">
                                            <a href="<?= route('detail-blog', array('id' => $cBlog->id, 'slug' => $cBlog->slug)) ?>">
                                                <?= $cBlog->title ?>
                                            </a>
                                        </h1>

                                        <div class="color66 font12">
                                            Đăng <?= date('d/m/Y', strtotime($cBlog->created_at)) ?>
                                            vào <?= date('H:i', strtotime($cBlog->created_at)) ?> - Mục:
                                            <a href="<?= route('category-blog', array('id' => $category->id, 'slug' => $category->slug)) ?>">
                                                <?= strtoupper($category->title) ?>
                                            </a>
                                        </div>
                                        <div class="MgT7 overH">
                                            <div class="listcomment FL">
                                                <span class="number">465</span>
                                                <span>Bình luận</span>
                                            </div>
                                            <div class="FL MgL5">

                                            </div>
                                        </div>
                                        <div class="items-news">
                                            <div class="box-pic">
                                                <a href="<?= route('detail-blog', array('id' => $cBlog->id, 'slug' => $cBlog->slug)) ?>">
                                                    <img
                                                        src="<?= Config::get('constants.URL_IMAGE_BLOG') . $cBlog->thumbnail ?>"
                                                        alt="">
                                                </a>
                                            </div>
                                            <div class="box-content-ns">
                                                <div>
                                                    <a href="<?= route('detail-blog', array('id' => $cBlog->id, 'slug' => $cBlog->slug)) ?>"
                                                       class="colorDackG font14">
                                                        <?= str_limit(strip_tags($cBlog->content), 300, '..'); ?>
                                                    </a>
                                                </div>
                                                <div class="btn">
                                                    <a href="<?= route('detail-blog', array('id' => $cBlog->id, 'slug' => $cBlog->slug)) ?>">Xem
                                                        thêm &raquo;</a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            <?
                            }
                        }
                        ?>
                    </ul>
                </div>
            </div>
        </div>
        <!--feature end-->
    </div>
</div>
<!--end content left-->
<!--content middle-->
<div class="width195 FL">
    <div class="news-sub">
        @include('frontend/blogs/includes/new-blog',array('blogs'=>$data['new_blog']))
    </div>
    <div class="event-cl-left MgT20 MgL5">
        <div class="bx-img width195">
            <div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
        </div>
        <div class="date-time width195">
            <div>
                <div class="displayin text-center">
                    <p class="font21 colorFF font-Light">10</p>

                    <p class="font10 colorFF font-seL">NGÀY</p>
                </div>
                <div class="displayin text-center"><p class="font13 colorFF font-Light positionR" style="top:-19px">
                        :</p></div>
                <div class="displayin text-center">
                    <p class="font21 colorFF font-Light">24</p>

                    <p class="font10 colorFF font-seL">GIỜ</p>
                </div>
                <div class="displayin text-center"><p class="font13 colorFF font-Light positionR" style="top:-19px">
                        :</p></div>
                <div class="displayin text-center">
                    <p class="font21 colorFF font-Light">59</p>

                    <p class="font10 colorFF font-seL">PHÚT</p>
                </div>
                <div class="displayin text-center"><p class="font13 colorFF font-Light positionR" style="top:-19px">
                        :</p></div>
                <div class="displayin text-center">
                    <p class="font21 colorFF font-Light">00</p>

                    <p class="font10 colorFF font-seL">GIÂY</p>
                </div>
            </div>
        </div>
        <div>
            <div class="bx-ct-ev width195">
                <div class="ctent">
                    <div class="colorFF">Offline</div>
                    <div class="font-Bold colorFF">Hội những người yêu thích nhạc Trịnh</div>
                    <div class="colorFF font11">Tại:</div>
                    <div class="font11 colorFF">Cung văn hóa Hữu Nghị Việt Sô</div>
                    <a href="#">Tham gia ngay</a>
                </div>
                <ul class="sug">
                    <li class="borderE5"><a href="#">Ngày hội văn hóa</a></li>
                    <li class="borderE5"><a href="#">Giao lưu âm nhạc </a></li>
                    <li class="borderE5"><a href="#">Cuộc thi guitar tháng 11</a></li>
                    <li class="borderE5"><a href="#">Từ điển âm nhạc</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--content middle end-->
<!--content right-->
<div class="default-width-right">
    <!--adv-->
    <div class="box-adv-right">
        <div class="adv-rectang">
            <a href="#"><img src="<?= asset('assets/commons/images/adv.jpg')?>" alt=""></a>
        </div>
    </div>
    <!--end adv-->
    <!--give mail-->
    <div class="MgT20">
        <div class="box-right">
            <div class="title-box">
                Gương mặt quán quân
            </div>
            <div class="ct-box border-B-G">
                <div class="bx-give-mail">
                    <div class="icon-give-mail">&nbsp;</div>
                    <div class="content-give-mail font12 color55">Bạn sẽ nhận được từ chúng tôi những tin mới nhất về
                        guitar trong nước cũng như thế giới.
                    </div>
                    <div class="bx0in">
                        <input class="FL" type="text"
                               onfocus="javascript:if(this.value=='Nhập email của bạn'){this.value='';}"
                               onblur="javascript:if(this.value==''){this.value='Nhập email của bạn';};"
                               value="Nhập email của bạn" name="username"/>
                        <input class="FL" type="submit" value="Gửi">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--give mail end-->
    <!--Đọc nhiều nhất-->
    <div class="MgTB20">
        @include('frontend/blogs/includes/view-blog',array('blogs'=>$data['views_blog']))
    </div>
    <!--Đọc nhiều nhất end-->

</div>
<!--end content right-->
@stop